package com.situ.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.situ.service.DanjuService;
import com.situ.service.StatisticsService;
import com.situ.service.impl.DanjuServiceImpl;
import com.situ.service.impl.StatisticsServiceImpl;
import com.situ.util.BaseController;
import com.situ.vo.DanjuVO;
import com.situ.vo.LayuiTableVO;
import com.situ.vo.StatisticsVO;

@WebServlet("/statistics")
public class StatisticsController extends BaseController{

	private static final long serialVersionUID = 1L;

	StatisticsService service =new StatisticsServiceImpl();

	public void page(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.getRequestDispatcher("/WEB-INF/statistics.jsp").forward(request, response);
	}
	
	public LayuiTableVO list(Integer page, Integer limit, String keyword) {

		List<StatisticsVO> list = service.all(page, limit, keyword);
		LayuiTableVO vo = new LayuiTableVO();
		vo.setCode(0);
		vo.setData(list);
		//vo.setCount(service.count(keyword));
		vo.setCount(100L);
		return vo;
	}
}
